import { IPv4Reg } from '../consts'

/**
 * 判断 IPv4 地址是否合法
 *
 * @param {string} ip IPv4 地址
 * @returns {boolean} true 为合法，false 为非法
 */
export const isIpv4Legal = (ip: string): boolean => IPv4Reg.test(ip)

export type IsIpv4LegalType = typeof isIpv4Legal
